let color = '#C71D23';

chrome.runtime.onInstalled.addListener(() => showPopup());

chrome.tabs.onActivated.addListener(activeInfo => showPopup());

async function showPopup() {
    let queryOptions = { active: true, currentWindow: true };
    let [tab] = await chrome.tabs.query(queryOptions);
    if (tab.url
        && (
            tab.url.startsWith('https://www.youtube.com/')
            || tab.url.startsWith('https://www.bilibili.com/'))) {
        chrome.tabs.create({
            url: 'popup.html'
        });
    }
    console.log('加油！')
}
